package edu.wust;

public class exam40 {
    public static int num(int n){
        int count=0;
        while(n!=0){
            n/=10;
            count++;
        }
        return count;
    }
    public static int many0(int n){
        int t=1;
        for(int i=1;i<n;i++)
            t*=10;
        return t;
    }
    public static void main(String[] args) {
        int d=1,count=0;
        for(int i=1;;++i){
            int n=num(i),temp=i,much0=many0(n);
            while(much0!=0){
                count++;
                if(count==1||count==10||count==100||count==1000||count==10000||count==100000||count==1000000){
                    d*=temp/much0;
                }
                temp%=much0;
                much0/=10;
            }
            if(count>=1000000)
                break;
        }
        System.out.println(d);
    }
}

